package cn.com.sinosoft.ares.channel.service.impl;

import cn.com.sinosoft.ares.channel.service.AbstractZTTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;

import java.io.InputStream;

/**
 * Description:
 * Author: lishangmin
 * Created: 2018-09-14 18:02
 */
@Slf4j
@Service("templateServiceImpl_ZT_061598")
public class TemplateServiceImpl_ZT_061598 extends AbstractZTTemplateService {

    private static String template;

    static {
        try {
            ClassPathResource resource = new ClassPathResource("zt_061598_temp_vm.txt");
            InputStream inputStream = resource.getInputStream();
            template = IOUtils.toString(inputStream);
            log.info(template);
        }catch (Exception e){
            log.error("加载文件异常",e);
        }
    }

    @Override
    public String fromJSON(String message) {
        return super.fromJSON(message,template);
    }

}
